<!--用户操作弹窗-->
<ng-template #modalContent>
    <nz-spin [nzSpinning]="modalLoadingState">
        <form nz-form [formGroup]="dataForm" nzLayout="vertical">
            <div nz-row [nzGutter]="24">
                <div nz-col nzSpan="24">
                    <nz-form-item>
                        <nz-form-label nzRequired>任务名称</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input [(ngModel)]="entity.jobName" formControlName="jobName" placeholder="请输入10个字符以内的真实姓名" />
                            <ng-template #errorNameTpl let-control>
                                <ng-container *ngIf="control.hasError('required')">名称不能为空</ng-container>
                            </ng-template>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col nzSpan="24">
                    <nz-form-item>
                        <nz-form-label>任务分组</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <app-dict-select [dictKey]='"sys_job_group"' [(selectKey)]='entity.jobGroup'></app-dict-select>
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="24">
                    <nz-form-item>
                        <nz-form-label nzRequired>调用方法</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input [(ngModel)]="entity.invokeTarget" formControlName="invokeTarget" placeholder="请输入调用方法" />
                            <ng-template #errorNameTpl let-control>
                                <ng-container *ngIf="control.hasError('required')">不能为空</ng-container>
                            </ng-template>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col nzSpan="24">
                    <nz-form-item>
                        <nz-form-label nzRequired>cron表达式</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input [(ngModel)]="entity.cronExpression" formControlName="cronExpression" placeholder="请输入10个字符以内的权限字符" />
                            <ng-template #errorNameTpl let-control>
                                <ng-container *ngIf="control.hasError('required')">不能为空</ng-container>
                            </ng-template>
                        </nz-form-control>
                    </nz-form-item>
                </div>


                <div nz-col nzSpan="24">
                    <nz-form-item>
                        <nz-form-label>状态</nz-form-label>
                        <nz-form-control>
                            <nz-switch
                                [(ngModel)]="entity.status"
                                formControlName="status"
                                nzCheckedChildren="正常"
                                nzUnCheckedChildren="暂停"
                            ></nz-switch>
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label>执行策略</nz-form-label>
                        <nz-form-control>
                            <nz-radio-group [(ngModel)]="entity.misfirePolicy" nzButtonStyle="solid" formControlName='misfirePolicy'>
                                <label nz-radio-button nzValue="1">立即执行</label>
                                <label nz-radio-button nzValue="2">执行一次</label>
                                <label nz-radio-button nzValue="3">放弃执行</label>
                            </nz-radio-group>
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label>是否允许并发</nz-form-label>
                        <nz-form-control>
                            <nz-radio-group [(ngModel)]="entity.concurrent" nzButtonStyle="solid" formControlName='concurrent'>
                                <label nz-radio-button nzValue="0">允许</label>
                                <label nz-radio-button nzValue="1">禁止</label>
                            </nz-radio-group>
                        </nz-form-control>
                    </nz-form-item>
                </div>
            </div>
        </form>
    </nz-spin>
</ng-template>
<ng-template #modalFooter>
    <button nz-button nzType="primary" [disabled]="dataForm.invalid" [nzLoading]="saveLoadingState" (click)="onSave()">
        保存
    </button>
</ng-template>

